package net.sky.oa.test.dao.system;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import net.sky.oa.dao.system.SysSchoolDao;
import net.sky.oa.model.SysSchool;
import net.sky.oa.test.BaseTestCase;

import org.junit.Test;
import org.springframework.test.annotation.Rollback;

public class SysSchoolDaoTestCase extends BaseTestCase {

	@Resource
	private SysSchoolDao sysSchoolDao;

	@Test
	@Rollback(false)
	public void add() {
		SysSchool sysSchool = new SysSchool();
		sysSchool.setName("TestName");
		sysSchool.setCreatetime(new Date());
		sysSchool.setAddress("address");
		this.sysSchoolDao.save(sysSchool);
	}

	@Test
	@Rollback(false)
	public void find() {

		List<SysSchool> schools = this.sysSchoolDao.findAllSchool();
		for (SysSchool school : schools) {
			System.out.println("getName:" + school.getName());
		}
	}
}